<?php
if (!defined('BASEPATH'))
	exit('No direct script access allowed');

class Profile extends MX_Controller {

	public function __construct() {
		parent::__construct();

		$this->template->set_theme('admin');
		$this->template->set_layout('default');
		$this->template->set_partial('side_menu','layouts/side_menu');
		$this->template->set_partial('nav_bar','layouts/nav_bar');
		$this->load->model('admin_member_model');
	}
	function index()
	{

		$data['profile']['details'] = $this->admin_member_model->getMemberdetails();

		
		
		$this->template->build('member/profile',$data);
	}

	function update_profile()
	{
		
			
			
					
				
				$type = $this->input->post('type');
				
				$profiledata=array(
						
						
						
						
						'type' => $type,
						'name'=> $this->input->post('admin_name'),
						);
			
				//--Delete Old Image File--//



		if($profiledata == TRUE){
		
					
				$this->db->where('type',$this->input->post('type'));
				$this->db->update('member',$profiledata);
				$this->session->set_flashdata('message', 'Profile Updated Sucessfully!... ');
				redirect('secure/member/profile/');
					
		}else{
			$this->session->set_flashdata('message', 'fields can not be null!... ');
			redirect('secure/member/profile/');
			
		}	
		
			
	}

}
